package com.mustafaiev.tair.cts.facade;

import java.util.List;

import com.mustafaiev.tair.cts.dto.PurchaseDTO;
import com.mustafaiev.tair.cts.exeption.DataNotStoredException;

public interface IPurchaseFacade extends ICostTrackingSystemFacade {

	/**
	 * Saves purchase
	 * 
	 * @param dto
	 */
	void save(PurchaseDTO dto) throws DataNotStoredException;

	/**
	 * Saves purchases
	 * 
	 * @param dto
	 */
	void saveBatch(List<PurchaseDTO> dtos) throws DataNotStoredException;

	/**
	 * Deletes passed purchase from database
	 * 
	 * @param purchaseDTO
	 */
	void delete(PurchaseDTO purchaseDTO);

	/**
	 * Deletes passed purchases batch from database
	 * 
	 * @param purchases
	 */
	void deleteBatch(List<PurchaseDTO> purchases);

	/**
	 * Retrieves purchases from database
	 * 
	 * @return {@link List} of {@link PurchaseDTO}
	 */
	List<PurchaseDTO> retrievePurchases();

	/**
	 * Retrieves purchase from database by passed id
	 * 
	 * @param id
	 * @return {@link PurchaseDTO}
	 */
	PurchaseDTO retrievePurchase(Long id);

	/**
	 * Retrieves list of purchases for basket
	 * 
	 * @param basketId
	 * @return purchases list
	 */
	List<PurchaseDTO> retrievePurchasesForBasket(Long basketId);

}
